package com.zj.viewpagerdemo.adapter;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v7.app.ActionBar;

import com.zj.viewpagerdemo.fragment.MainFragment;

/**
 * Created by Lenovo on 2017/4/25.
 */

public class MainAdapter extends FragmentPagerAdapter {

    private static final String[] Tabs = {"first", "left", "middle", "right", "last"};

    public MainAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return MainFragment.newInstance(Tabs[position]);
    }

    @Override
    public int getCount() {
        return Tabs.length;
    }
}
